package com.class05.l_innerclass.a;

public interface Animal {
    public abstract void eat();
    public abstract String sleep();
}


class TestMain{
    public static void main(String[] args) {
        new Animal(){
            @Override
            public void eat(){
                System.out.println("吃");
            }
            @Override
            public String sleep(){
                System.out.println("睡");
                return "睡";
            }
        }.eat();
       String a = new Animal(){
            @Override
            public void eat(){
                System.out.println("吃");
            }
            @Override
            public String sleep(){
                System.out.println("睡");
                return "睡";
            }
        }.sleep();



        Animal animal = new Animal(){
            @Override
            public void eat(){
                System.out.println("吃");
            }
            @Override
            public String sleep(){
                System.out.println("睡");
                return "睡";
            }
        };
        animal.eat();
        String b = animal.sleep();
    }
}